Skip to content

fix: swap rows/cols in exec resize adapter - #54

Merged
joshuapare merged 1 commit into
mainfrom
fix/resize-rows-cols-swap
Mar 28, 2026
Merged

fix: swap rows/cols in exec resize adapter#54
joshuapare merged 1 commit into
mainfrom
fix/resize-rows-cols-swap

Conversation

@joshuapare

@joshuapare joshuapare commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • AdapterV1.ResizeSession receives (cols, rows) but passes them straight through to PluginClient.ResizeSession which expects (rows, cols)
  • This caused the remote terminal to receive swapped dimensions (e.g. 236×36 instead of 36×236)
  • Result: terminal output corruption — lines wrapping/scrolling at wrong positions

Verified via stty size in exec session showing 236 36 (rows cols) instead of 36 236.

Test plan

  • Exec into a pod, run stty size — should match the UI terminal dimensions
  • Run ls -lah / — output should render without corruption

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue with terminal session resizing where arguments were being passed in the incorrect order, ensuring proper display dimensions are applied.

AdapterV1 has (cols, rows) parameter order but PluginClient expects
(rows, cols). Passing them straight through caused the remote terminal
to receive swapped dimensions (e.g. 236 rows × 36 cols instead of
36 rows × 236 cols), corrupting terminal output.
@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6e4dc6f6-95ef-46a5-b1c5-4d874cb139d6

📥 Commits

Reviewing files that changed from the base of the PR and between 54ae0ce and 6b86ee0.

📒 Files selected for processing (1)
  • backend/pkg/plugin/exec/adapter_v1.go

📝 Walkthrough

Walkthrough

The ResizeSession method in AdapterV1 has been updated to reverse the order of cols and rows arguments when delegating to the underlying inner.ResizeSession call. The public method signature remains unchanged; only the internal argument order is modified.

Changes

Cohort / File(s) Summary
Argument Order Fix
backend/pkg/plugin/exec/adapter_v1.go
Swapped cols and rows argument order in the ResizeSession delegation to the inner implementation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A hop, a flip, the args now dance,
Cols and rows in new stance,
Dimensions flow the right way through,
Adapter's heart beats strong and true! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/resize-rows-cols-swap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@joshuapare
joshuapare merged commit 94485cc into main Mar 28, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant